<%@ taglib prefix="form" uri="/WEB-INF/tlds/hdiv-spring-form-3_0_4.tld"%>
<%@ taglib prefix="c" uri="/WEB-INF/tlds/hdiv-c.tld"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<c:url value="login.html" var="login"/>
<script type="text/javascript">
    $(document).ready(function(){
        $("#usuario").focus();
        //$("#usuario").bestupper();
        //$("#empresa").bestupper();
    });
    function valida_usuario() {
      if (event.keyCode == 13)
          if (document.forms[0].usuario.value == "")
            alert("Ingrese el Usuario");
          else
            document.forms[0].password.focus();
    }
    function valida_password() {
      if (event.keyCode == 13)
          if (document.forms[0].password.value == "")
            alert("Ingrese el Password");
          else
            document.forms[0].empresa.focus();
    }
    function valida_empresa() {
      if (event.keyCode == 13)
          if (document.forms[0].empresa.value == "")
            alert("Ingrese el Password");
          else
            document.forms[0].submit();
    }  

    </script>  

  <form:form modelAttribute="form" action="${login}">
    <table  width="775"  align="center" cellpadding="0" cellspacing="0" border="0" bgcolor="#FFFFFF">
      
      <tr>
            <td>
            <script type="text/javascript">
            var MM_contentVersion = 8;
            var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ?
            navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
            
                //alert("plugin"+plugin);
                
                if ( plugin ) {
                        var words = navigator.plugins["Shockwave Flash"].description.split(" ");
                
                        for (var i = 0; i < words.length; ++i) {
                                if (isNaN(parseInt(words[i])))
                                continue;
                                var MM_PluginVersion = words[i];
                        }
                
                        var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
                }
                else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.appVersion.indexOf("Win") != -1)) {
                        document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
                        document.write('on error resume next \n');
                        document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
                        document.write('</SCR' + 'IPT\> \n');
                }
        
                if (MM_FlashCanPlay){                    
                    AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','775','height','86','src','swfs/photos','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','swfs/photos' ); //end AC code                
                } else{                                
                    document.write('<a href="http://www.macromedia.com/go/getflashplayer/" target="_blank"><img src="images/msgflash.jpg" alt="" border="0" height="86" width="775"/></a>');                		
                }            

            </script>  
    
           
            </td>
      </tr>

    <tr>
        <td valign="top" class="fondo_contenido padleft206">
         <table border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td colspan="3" valign="top"><img src="images/spacer.gif" width="22" height="22"></td>
            </tr>
          <tr>
            <td width="90" rowspan="7" valign="top" class="fondo_novedades">
            <table width="83" border="0" align="right" cellpadding="0" cellspacing="0">
              <tr>
                <td align="left" class="arial11w"><strong>
                <br>
                <br>
                <br>
                <br>
                <br>
                NOVEDADES HERMES</strong></td>
              </tr>
            </table></td>
            
            <td colspan="2" class="padleft20"><span class="verdana11bazul">Llene los campos para ingresar al sistema</span>
            </td>
            </tr>
          <tr>
            <td colspan="2"><img src="images/spacer.gif" width="20" height="20"></td>
            </tr>
          <tr>
            <td valign="top" align="center" ><span class="verdana11azul">USUARIO</span></td>
            <td valign="top" align="left">
                <div  class="fondo_txtboxlogin"><form:input path="usuario" onfocus="select_text(this)" onkeypress="valida_usuario()"
                                        maxlength="10" size="12" 
                                    tabindex="1"/>
                     </div>               
                                    </td> 
          </tr>
          <tr>
            <td valign="top" align="center"><span class="verdana11azul">PASSWORD</span></td>
            <td valign="top" align="left">
             <div  class="fondo_txtboxlogin"><form:password path="password" autocomplete="false" onfocus="select_text(this)" onkeypress="valida_password()"
                                       tabindex="2" maxlength="10" size="12"
                                    /></div></td>
          </tr>
          <tr>
            <td valign="top" align="center"><span class="verdana11azul">EMPRESA</span></td>
            <td valign="top" align="left">
                <div  class="fondo_txtboxlogin"><form:input path="empresa" onfocus="select_text(this)" onkeypress="valida_empresa()"
                                   tabindex="3"     maxlength="10" size="12" 
                                    /></div></td>
          </tr>
          <tr>
            <td valign="top"></td>
            <td valign="top">                  
            </td>
          </tr>          
          <tr>
            <td colspan="2" align="right" valign="top">
                <input name="Submit2" type="button" class="boton" value="Ingresar" onclick="javascript:submitForm();" tabindex="4"/>                
                
            </td>
          </tr>
          <tr>
            <td class="padtop12 padleft20" align="right"  colspan="3" valign="top" style="color:red;font-size:11px;">
                <form:errors path="*" cssClass="error"/>
            </td>
            </tr>
        </table>
    </td>
      </tr>      
 
    <tr>
        <td valign="bottom" width="100%" height="150">
         <table width="775" id="fullheighttable_i" border="0" cellspacing="0" cellpadding="0" >
            <tr>
                <td width="100%">
                </td>
            </tr>   
        </table>
        </td>
    </tr>  
      
    </table>  
  </form:form>
  <script type="text/javascript">    
    document.forms[0].setAttribute("autocomplete","off");  
  </script>